Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

179
Vistas
How to insert text in Toast UI Editor [React] for button click

How to insert the text in editor for the button click on toast ui react editor We have created a separate button in toastui editor tab, In below code we have inserted the text in console for the button click, we want to insert the same in Editor

import React from "react";
import "@toast-ui/editor/dist/toastui-editor.css";
import { Editor } from "@toast-ui/react-editor";

function Editor4() {
  let editorRef = React.createRef();

  //Adding item based on button click
  const handleClick = () => {
    editorRef.current
      .getInstance()
      .addCommand("markdown", "additem", function additem() {
        console.log("ButtonClicked");
      });
  };
  return (
    <div>
      <div>
        <Editor
          initialValue="Hello"
          previewStyle="vertical"
          height="400px"
          initialEditType="markdown"
          ref={editorRef}
          toolbarItems={[
            [
              "heading",
              "bold",
              {
                name: "Button",
                tooltip: "myItem",
                command: "additem",
                className: "toastui-editor-toolbar-icons",
                text: "V",
              }]
          ]}
        />
        <button onClick={handleClick}>makeBold</button>
      </div>
    </div>
  );
}
about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda